/*
 * @Author: xiongyi
 * @Date: 2022-12-01 11:00:58
 * @LastEditors: xiongyi
 * @LastEditTime: 2022-11-14 16:11:05
 * @Description: 登录页接口
 */
import request from '@/assets/common/js/utils/request'

// 登陆接口
export function login(data) {
    var  form = new FormData();
    form.append("username",data.username)
    form.append("password",data.password)
	return request({
		url: 'users/login',
		method: 'post',
        data: form
	});
}
/**
* @description 退出登陆
* @param
* @return
* @author qiankui 2023-4-28 14:48:46
**/
export function logout() {
    return request({
        url: "users/logout",
        method: "POST"
    })
}

/**
 * @description 获取用户类型
 * @param not
 * @return not
 * @author qiankui 2023-5-19 17:43:14
 **/
export function accountinfoGetusertype(userName) {
    return request({
        url: 'accountinfo/getusertype?userName='+userName,
        method: 'get'
    });
}


export function GetuserinfoById(userId) {
    return request({
        url: 'accountinfo/get?id='+userId,
        method: 'get'
    });
}

/**
 * @description 设置缓存
 * @param not
 * @return not
 * @author qiankui 2023-6-5 14:06:55
 **/
export function cachestroeSet(data) {
    return request({
        url: 'cachestroe/set',
        method: 'post',
        data: data,
    });
}

/**
 * @description 获取缓存
 * @param not
 * @return not
 * @author qiankui 2023-6-5 14:08:00
 **/
export function cachestroeGet(key) {
    return request({
        url: 'cachestroe/get?key='+key,
        method: 'get'
    });
}
/**
 * @description 删除缓存
 * @param not
 * @return not
 * @author qiankui 2023-6-5 14:16:38
 **/
export function cachestroeRemove(key) {
    return request({
        url: "cachestroe/remove?key="+key,
        method: 'DELETE',
    });
}